import request from "@/utils/request"

export function login(username,password){
    return request({
        url: '/login',
        method: "post",
        data: {
            username,
            password
        }
    })
}

// export function getUserInfo(token){
//     return request({
//         url: `user/info/${token}`, //拼接字符串要用反单引号，参数带到了路径变量上面
//         method: "get",
//     })
// }

export function logout(token){
    return request({
        url: `user/logout`, //拼接字符串要用反单引号，参数带到了路径变量上面
        method: "post",
        data: {
            token
        }
    })
}